import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
//三级联动组件-全局
import TypeNav from  '@/components/TypeNav'
import store from '@/store'
import '@/mock/mockServe'
import Pagnation from '@/components/Pagnation'
//在main.js里面可以任意使用
import 'swiper/css/swiper.css'
import Carousel from '@/components/Carousel'
import { MessageBox,Message } from 'element-ui';
import VueLazyload from 'vue-lazyload'
import atm from '@/assets/images/1.gif'
//注册，第一个参数：全局组件的名字 第二个参数：哪一个组件
Vue.component(TypeNav.name,TypeNav)
Vue.component(Carousel.name,Carousel)
Vue.component(Pagnation.name,Pagnation)
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$message = Message;
Vue.use(VueLazyload,{
  //懒加载的图片
  loading:atm
})

Vue.config.productionTip = false
//统一接口api文件夹里面的全部接口函数
import * as API from '@/api'
import '@/plugins/validate'

new Vue({
  //全局事件总线
  beforeCreate() {
    Vue.prototype.$bus = this; 
    Vue.prototype.$API = API;
  },
  render: h => h(App),
  router,
  store
}).$mount('#app')
